﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SystemCenterSoa.PoModel.SystemManager;
using SystemCenterSoa.Service.SystemManager;

namespace SystemCenterSoa.ApiProject.Area.SystemManager
{
    public class QualificationController : SystemManagerBaseController
    {
        private QualificationService _qualificationService;
        public QualificationController(QualificationService qualificationService)
        {
            _qualificationService = qualificationService;
        }
        /// <summary>
        /// 分页条件查询
        /// </summary>
        /// <param name="atleName"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetQualificationList(string quaName, string queLevel, DateTime? quaAnnualAuditDate)
        {
            try
            {
                var list = _qualificationService.GetQualificationList(quaName, queLevel, quaAnnualAuditDate);
                return Ok(new { list });
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="Qualification"></param>
        /// <returns></returns>
        [HttpPost]
        public bool GetQualificationAdd(QualificationPo Qualification)
        {
            return _qualificationService.GetQualificationAdd(Qualification);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public bool GetQualificationDel(string ids)
        {
            return _qualificationService.GetQualificationDel(ids);
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public QualificationPo GetQualificationFan(int id)
        {
            return _qualificationService.GetQualificationFan(id);
        }
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="Qualification"></param>
        /// <returns></returns>
        [HttpPost]
        public bool GetQualificationUpdate(QualificationPo Qualification)
        {
            return _qualificationService.GetQualificationUpdate(Qualification);
        }
    }
}
